//用户登录和获取用户信息的API
import request from "@/utils/request";
import type { loginData, ResponseData, checkUser } from "./type";
enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
  LAYOUT_URL = "/admin/acl/index/logout",
}
//用户登录的方法
export const reqLogin = (data: loginData) => {
  return request.post<any, ResponseData<string>>(API.LOGIN_URL, data);
};
//获取用户信息的方法
export const reqUserInfo = () => {
  return request.get<any, ResponseData<checkUser>>(API.USERINFO_URL);
};
//退出登录
export const reqLayout = () => {
  return request.post<any, any>(API.LAYOUT_URL);
};
